#!/bin/bash

build_lua(){
	cd lua53
	make all
	cd ..
	if test ! -d output; then
		mkdir output
	fi
	cd output
	if test ! -d lua; then
		mkdir lua
	fi
	cd ..
	cp lua53/output/bin/* output/lua/
	clean_lua
}

clean_lua(){
	cd lua53
	make MAKE=make clean
	cd ..
}

if test $1 = "lua"; then
	build_lua
elif test $1 = "clean"; then
	rm -rf output
	clean_lua
fi

